#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author: liang kang
@contact: gangkanli1219@gmail.com
@time: 2018/5/24 12:11
@desc: 
"""
from pathlib import Path


# >INFO CSV and H5PY key
class DataField(object):

    PATIENT_ID = 'patient_id'
    NODULE_ID = 'nodule_id'
    SERIES_ID = 'series_id'
    INDEX_ID = 'index_id'
    CENTROID = 'centroid'
    DIAMETER = 'diameter'
    POINTS = 'points'


# >INFO file path
class Files(object):

    __file = Path(__file__).parent.parent
    DATA_ROOT = Path(__file) / 'data'
    if not DATA_ROOT.exists():
        DATA_ROOT.mkdir()

    ORIGIN_ROOT = DATA_ROOT / 'origin'
    if not ORIGIN_ROOT.exists():
        ORIGIN_ROOT.mkdir()

    NODULE_ROOT = DATA_ROOT / 'nodule'
    if not NODULE_ROOT.exists():
        NODULE_ROOT.mkdir()

    NODULES = 'nodules.csv'
    FEATURE = 'feature.csv'


# >INFO numerical
class Number(object):

    # mm
    SPACING = 2.5
    RESAMPLE_SPACING = (0.5, 0.5, 0.5)

    BACKGROUND_PIXEL = -32000
    THRESHOLD = -600

    PADDING_SIZE = 45
    ADD_SIZE = 4

    HEAD_RANGE = 100
    AIRWAY_RANGE = 40
    AIRWAY_AREA = 2025
    AIRWAY_ADD_SIZE = 10
    AIRWAY_BALL = 4
    AIRWAY_CROSS = 2


# >INFO data pipe
class DataPipe(object):

    # back
    BACK = 'back'
    SAMPLED = 'sampled'
    LUNG_MASK = 'lung_mask'

    # airway
    AIRWAY = 'airway'
    AIRWAY_MASK = 'airway_mask'
    LUNG_NO_AIRWAY = 'lung_without_airway'

